﻿/* 
 *  <copyright file="CollisionCatagories.cs" company="Wesley Jowitt">
 *  
 *  SobrietyEngine: Copyright (c) 2011 Wesley Jowitt
 *  
 *  This software is distributed under a software license.
 *   * As of the creation time of this file, the license in use is the Microsoft Permissive License (Ms-PL) 
 *    * The license can be viewed at:
 *     * License.Txt in the root folder of this project
 *      * http://sobrietyengine.codeplex.com/license
 *       * http://www.microsoft.com/opensource/licenses.mspx
 *       
 *  </copyright>
 *   */

using System;
using FarseerPhysics.Dynamics;

namespace SobrietyEngine.Physics
{
    public class CollisionCatagories
    {
        static CollisionCatagories()
        {           
        }

        //Is/Are = what cats objects of that strType are set to be in
        //Hits / Hit = what objects they collid and Hit with
        //The title string for each is the scriptable catagory name
        //think of better way to do this, so its both accessable via list/array for scripting
        //and as static for use in code

        public static Category All = Category.All;

        //for bodies that will never collide (not sure what would use this, scenery?)
        public static String None = "CollisionCategory.None";
        public static Category HasNone = Category.None;
        public static Category HitsNone = Category.None;
        
        //collision cat for the ground, and what the ground Hits to
        public static String Ground = "CollisionCategory.Ground";
        public const Category GroundIs = Category.Cat1;
        public static Category GroundHits = MoversAre | PlayerHitBoxesAre;

        //movers are the circle and wheels that move actors around. 
        //they generally Hit to 'ground' catagory actors, and other solid actors
        public static String Movers = "CollisionCategory.Movers";
        public const Category MoversAre = Category.Cat2;
        public static Category MoversHit = GroundIs | MoverTriggersAre | SolidHitBoxesAre;

        //things that can Hit to movers (not sure what this would be - pressure sensors?)
        //Triggers may need to be in a catagory themselves
        public const Category MoverTriggersAre = Category.Cat8;
        public static Category MoverTriggersHit = MoversAre;

        //triggers Hit to actor hit boxes moving into them
        public const Category ActorTriggersAre = Category.Cat3;
        public static Category ActorTriggersHit = SolidHitBoxesAre | GhostHitBoxesAre;

        //triggers Hit to player hit boxes
        public const Category PlayerTriggersAre = Category.Cat9;
        public static Category PlayerTriggersHit = PlayerHitBoxesAre;

        //bodies for actors used as hit boxes
        //these are things movers can Hit too
        public const Category SolidHitBoxesAre = Category.Cat4;
        public static Category SolidHitBoxesHit = SolidHitBoxesAre | MoversAre | ActorTriggersAre;

        //bodies for actors used as hit boxes
        //that movers do not Hit to
        public const Category GhostHitBoxesAre = Category.Cat5;
        public static Category GhostHitBoxesHit = Category.None;

        //Special collision catagery so that things can Hit to the player only
        //set this on player, then anything that collides with cat6 will subscribe to player collisions
        public const Category PlayerHitBoxesAre = Category.Cat6;
        public static Category PlayersHitBoxesHit = Category.None; //not sure about this.

        //special catagory for bullets
        public const Category BulletsAre = Category.Cat7;
        public static Category BulletsHit = GroundIs | SolidHitBoxesAre;
    }
}
